package sk.tuke.magsa.personalistika.ui;

import sk.tuke.magsa.framework.ui.TableDialog;
import sk.tuke.magsa.personalistika.Application;
import sk.tuke.magsa.personalistika.entity.Oddelenie;

public class OddelenieTable extends TableDialog<Oddelenie> {
    public OddelenieTable() {
        super(Application.getInstance().getOddelenieDao());
    }

    protected OddelenieForm createFormDialogForInsert() {
        return new OddelenieForm();
    }

    protected OddelenieForm createFormDialogForEdit(Oddelenie entity) {
        return new OddelenieForm(entity);
    }

    protected void printHeader() {
        System.out.print(String.format("|%5s", "ID"));
        System.out.print(String.format("|%10s", "nazov"));
        System.out.print(String.format("|%10s", "kod"));
        System.out.println();
    }

    protected void printRow(Oddelenie entity) {
        System.out.print(String.format("|%5d", entity.getIdent()));
        System.out.print(String.format("|%10s", entity.getNazov()));
        System.out.print(String.format("|%10s", entity.getKod()));
        System.out.println();
    }

    protected void printNumberPropertiesMenu() {
        System.out.println("Select property you want to search by");
        System.out.println("(0) nazov");        
        System.out.println("(1) kod");        
        System.out.println("Enter selection: ");
    }
}